package com.springdoor.wx.api.controller;

import com.springdoor.wx.api.entity.ResultCategory;
import com.springdoor.wx.api.service.SprdGoodsTypeService;
import com.springdoor.wx.core.controller.BaseController;
import com.springdoor.wx.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("category")
@RestController
public class CategoryController extends BaseController {

    @Autowired
    private SprdGoodsTypeService goodsTypeService;

    @GetMapping("fetchCategory")
    public AjaxResult fetchCategory() {
        return success(goodsTypeService.fetchCategory());
    }

    @GetMapping("fetchCategoryTree")
    public AjaxResult fetchCategoryTree() {
        return success(goodsTypeService.fetchCategoryTree());
    }
}
